#define _CRT_SECURE_NO_WARNINGS 1



class Solution {
public:
    int NumberOf1Between1AndN_Solution(int n)
    {
        int res = 0;
        for (int i = 1; i <= n; i++)
        {
            for (int j = i; j > 0; j /= 10)
            {
                if (j % 10 == 1) res++;
            }
        }
        return res++;
    }
};